package elmar.swt;

public class Util {
	public static int log2(int _num) {
		if (_num < 1)
			return -1;
		for(int i=1;i<32;i++){
			if(_num>>i==0)return i-1;
		}
		return -1;
	}

	public static boolean is2N(int _num) {
		if(_num<=0)return false;
		return ((_num)&(_num-1))==0;
	}
}
